PACKAGE_DIR = ..


# source files.
SRCDIR = ../../src
OBJDIR = ./obj

FILES =  									\
			bmp_loader.cpp						
			
#OBJ = $(SRC:.cpp=.o)
OBJ_FILES = $(FILES:.cpp=.o)
OBJ =  $(patsubst %,$(OBJDIR)/%,$(OBJ_FILES))

SRC =  $(patsubst %,$(SRCDIR)/%,$(FILES))

OUT = bmp_loader

OBJ_REQ_FOLDER := 	./obj 		

# include directories
INCLUDES = -I. 	-I$(SRCDIR)

# C++ compiler flags (-g -O2 -Wall)
CCFLAGS = -g

# compiler
CCC = g++

# library paths
LIBS = -lGL -lglut -lGLU

# compile flags
LDFLAGS = -g

.SUFFIXES: .cpp

build: dep $(OBJ_REQ_FOLDER) $(OUT) 

$(OBJDIR)/%.o : $(SRCDIR)/%.cpp
	$(CCC) $(INCLUDES) $(CCFLAGS) -c $< -o $@

$(OUT): $(OBJ)
	ar rcs $(OUT) $(OBJ)
	cp $(OUT) $(PACKAGE_DIR)/lib
	cp $(SRCDIR)/*.h $(PACKAGE_DIR)/inc
	
	
$(OBJ_REQ_FOLDER):
			@echo $@
			mkdir $@

depend: dep

dep:
	#makedepend -- $(CFLAGS) -- $(INCLUDES) $(SRC)

clean:
	rm -f $(OBJ) $(OUT)
	rm -f $(PACKAGE_DIR)/lib/$(OUT)
	rm -f $(PACKAGE_DIR)/inc/*.h
	
#	rmdir $(OBJ_REQ_FOLDER)

	
	
	
